



























revision:
code: <div class="panel"> <div>Size: [<span>10vw</span>] <input type="range" min="1" max="20" step="1" value="10" name="s"></div> <div>Ratio: [<span>1</span>] <input type="range" min="0" max="2" step="0.05" value="1" name="r"></div> <div>Spacing: [<span>0vw</span>]<input type="range" min="0" max="1" step="0.1" value="0" name="mv"></div> <div>Clip-path<br> hc: [<span>0.5</span>]<input type="range" min="0" max="0.5" step=".05" value="0.5" name="h"><br> vc: [<span>0</span>]<input type="range" min="0" max=".5" step=".05" value="0" name="v"> </div> </div> <div class="main"> <div class="container"> <div><img src="../images/1.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/2.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/3.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/4.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/5.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/1a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/2a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/3a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/4a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/5a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/1S.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/2S.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/3aa.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/3s.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/4a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/4s.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/5a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/6.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/7.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/8.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/9.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/6a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/7a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/8a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/9a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/10.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/10a.jpg" alt=holiday" width="100%" height="100%"/></div> <div><img src="../images/11.jpg" alt=holiday" width="100%" height="100%"/></div> </div> </div> <style> .panel {position: relative;width: 20vw;top: 1vw; left: 1vw;padding: 0.3vw;border: 0.1vw solid;border-radius: 1vw;background-color: skyblue; font-family: Helvetica, sans-serif;opacity: .8; margin-bottom: 2vw;} .panel:hover {opacity:1} .panel > div:not(:last-child) {border-bottom: 0.1vw solid;padding-bottom: 1vw;margin-bottom: 1vw;} *,*::before {transition:0.5s linear;} .main {display: grid; grid-template-columns: repeat(auto-fit,calc(var(--s) + 2*var(--mh))); justify-content:center; --s: 100px; --r: 1; --h: 0.25; --v: 0.35; --hc:calc(clamp(0,var(--h),0.5) * var(--s)) ; --vc:calc(clamp(0,var(--v),0.5) * var(--s) * var(--r)); --mv: 4px; --mh: calc(var(--mv) + (var(--s) - 2*var(--hc))/2); --f: calc(2*var(--s)*var(--r) + 4*var(--mv) - 2*var(--vc) - 2px); --nr: 7; --lw: calc(var(--nr)*(var(--s) + 2*var(--mh)));} .container {font-size: 0; max-width: var(--lw); grid-column: 1/-1; margin: 0 auto;} .container div { width: var(--s); margin: var(--mv) var(--mh); height: calc(var(--s)*var(--r)); display: inline-block; font-size:initial; clip-path: polygon(var(--hc) 0, calc(100% - var(--hc)) 0,100% var(--vc), 100% calc(100% - var(--vc)), calc(100% - var(--hc)) 100%,var(--hc) 100%,0 calc(100% - var(--vc)),0 var(--vc)); background: darkgrey; margin-bottom: calc(var(--mv) - var(--vc)); } .container div:nth-child(odd) { background:yellow;} .container::before{ content: ""; width: clamp(0px, (var(--lw) - 100%)*1000,calc(var(--s)/2 + var(--mh))); float: right; height: 120%; shape-outside: repeating-linear-gradient(#0000 0 calc(var(--f) - 3px),#000 0 var(--f));} .container i::before , .container-1 i::after{ content: ""; width: clamp(0px, (100% - var(--lw) + 1px)*1000,calc(50% - var(--mh) - var(--s)/2)); float: left; height: calc(var(--f)*(var(--nr) - 1)/2); shape-outside: linear-gradient(to bottom right,#000 50.5%,#0000 0);} .container i::after {float:right; shape-outside: linear-gradient(to bottom left,#000 49%,#0000 0);} img:hover{scale: 1.5;} </style> <script> let inputs = document.querySelectorAll('.panel > div input[type=range]') let elem = document.querySelector('.main') inputs.forEach(input => { input.addEventListener('change', function(e) { var p = e.target.getAttribute('name'); if(p=="s" || p=="mv") { elem.style.setProperty("--"+p, this.value+"vw"); e.target.previousElementSibling.innerHTML = this.value+"vw"; } else { elem.style.setProperty("--"+p, this.value); e.target.previousElementSibling.innerHTML = this.value; } }); }); </script>